package huxibianjie.com.lbscandroid.interfaces;


import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import huxibianjie.com.lbscandroid.task.Callback;
import huxibianjie.com.lbscandroid.task.Task;
import huxibianjie.com.lbscandroid.ui.Service;

public class InvFriendsViewImpl implements InvFriendsView {

    @Override
    public void getWeather(String id, final OnInvFriendsListener listener) {

        Task.create(Service.class).randomValidationCode(id).enqueue(new Callback<String>() {
            @Override
            public void onSuccess(@Nullable String str) {
                if (str != null)
                    listener.onSuccess(str);
                else
                    listener.onError();
            }

            @Override
            public void onFailure(@NonNull String error) {
                listener.onError();
            }
        });
    }
}
